package com.homedo.odin.solution.service;

import com.homedo.core.common.base.service.BaseService;
import com.homedo.odin.solution.dao.SolProductListMapper;
import com.homedo.odin.solution.model.dto.SolProductListDetail;
import com.homedo.odin.solution.model.entity.SolProductList;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p> 方案产品清单 服务实现类 </p>
 *
 * @author HarveyDing
 * @since 2018-03-08
 */
@Service
public class SolProductListServiceImpl extends BaseService<SolProductListMapper, SolProductList> {

    public List<SolProductListDetail> findSolList(String solName, Integer status) {
        return baseMapper.findSolList(solName, status);
    }

    public Integer updateListStatus(Long userId, Integer status, Integer listId, String userName) {
        return baseMapper.updateListStatus(userId, status, listId, userName);
    }

    public SolProductList getProductListById(int id) {
        return baseMapper.getProductListById(id);
    }

    public Integer updateListStatusBySolId(Long userId, Long solutionId, int status, String userName) {
        return baseMapper.updateListStatusBySolId(userId, solutionId, status, userName);
    }

    public SolProductList findOneById(Integer listId) {
        SolProductList solProductList = new SolProductList();
        solProductList.setId(listId);
        solProductList.setIsDel(0);
        return baseMapper.selectOne(solProductList);
    }
}
